home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
F1 Licenseware
/
F1 Licenseware - Volume 1.iso
/
disks
/
003.dms
/
003.adf
/
TEXT
/
chapter18.txt
< prev
next >
Wrap
Text File
|
1992-09-02
|
3KB
|
145 lines
The Absolute Beginners Guide To Amos
-------------------------------------
Chapter eighteen
-----------------
If you take a look at EXAMPLE18.Amos you will see it is a small Procedure
that you could use in your programs during development.
The Procedure is called _SYSTEMSTATUS and when called will display the
following information:
FAST MEMORY FREE
CHIP MEMORY FREE
DISK SPACE FREE DF0:
DISK SPACE FREE DF1:
VARIABLE SPACE FREE
The program is very straight forward and you should have little trouble
understanding it, but as usual I will cover each new command in detail.
This is a good example of why using Procedures can be useful. You could
build up a library of Procedures which you could use many times over in your
programs saving lots of development time, just like the Pro`s do.
DFREE
-----
Returns the space left on the currently in use disk in bytes.
For example:
PRINT DFREE
EXIST:
-----
You can use this command to find out if a file or drive EXISTs.
Some examples:
IF EXIST (PIC.IFF) THEN LOADIFF etc.......
IF EXIST (df1:) THEN DIR$="DF1:"
DIR$=
-----
Set the current directory or drive.
DIR$="DF1:"
Set the current drive to DF1:
DIR$="DF0:"
Set the current drive to DF0:
DIR$="DF0:PICS/"
Set the directory to PICS drawer of the disk in DF0:
FAST FREE
---------
PRINT FASTFREE would print the amount of FAST memory available in bytes.
CHIP FREE
---------
PRINT CHIP FREE would print the amount of CHIP memory available, this can be
used to good effect. For example, if you wanted to check if the Amiga your
program was running on had more than 512k then you could do this:
IF CHIP FREE+FAST FREE>512*1024 then ...............
FREE
----
PRINT FREE informs you of the amount of space you left for variables in your
program. See SET BUFFER command in chapter 16 if it is low.
That covers all the new commands that pop up in EXAMPLE18.Amos. Here are a
few more that may be of use or interest to you.
---------------------------------------------
KILL Filename$
--------------
KILL deletes the file in Filename$ from the current drive, once KILLed you
will not be able to recover this file. An example:
KILL "readme.doc" Will delete the file readme.doc
RENAME old$ TO new$
-------------------
Allows you to change the name of a file. As an example let us say we want to
RENAME readme.doc TO instructions.doc, we would execute the following:
RENAME readme.doc to instructions.doc
MKDIR
-----
Creates a drawer (or folder if you like) on the current disk. As an example
lets say we need a drawer to store our samples in we would:
MKDIR "samples"
LDIR
----
Lists the current directory of your disk to the printer.
LLIST
-----
Executing this command will print out your Amos program listing to your
printer. This command does not work on some versions of Amos.
* See Chapter 20 for how to get round this.
LPRINT
------
You can use this in exactly the same way as PRINT except the output is to
your printer:
LPRINT "THIS TEXT WILL BE SENT TO MY PRINTER"
OK that is enough new commands for this chapter.
End of chapter eighteen.